/* Yeah, you know. */

#include <QMenu>
#include <QMenuBar>
#include <QDockWidget>
#include <QTextEdit>

#include "MainWindow.h"
#include "UMLCanvas.h"
#include "UMLPalette.h"

MainWindow::MainWindow()
{
	setCentralWidget(new UMLCanvas(this));

	createMenus();
	createDocks();
}

void MainWindow::createMenus()
{
	QMenu *fileMenu = menuBar()->addMenu(tr("&File"));
	fileMenu->addAction(tr("E&xit"));
}

void MainWindow::createDocks()
{
	QDockWidget *dock = new QDockWidget(tr("UML Palette"), this);
	UMLPalette *palette = new UMLPalette(dock);

	dock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
	dock->setWidget(palette);

	addDockWidget(Qt::RightDockWidgetArea, dock);

	dock = new QDockWidget(tr("Properties"), this);
	QTextEdit *text = new QTextEdit("hi", dock);

	dock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
	dock->setWidget(text);
	addDockWidget(Qt::RightDockWidgetArea, dock);
}

